<template>
  <div class="app-container">
    <div class="head_search u-f u-f-ac u-fw">
      <div class="ipt_box u-f u-f-ac u-f-jsb">
        <p class="label font14 text_black">{{ $t("用户名") }}：</p>
        <el-input
          v-model="username"
          :placeholder="$t('请输入用户名')"
        ></el-input>
      </div>
      <div class="ipt_box u-f u-f-ac u-f-jsb">
        <p class="label font14 text_black">{{ $t("账户名") }}：</p>
        <el-input
          v-model="drawname"
          :placeholder="$t('请输入提现账户名字')"
        ></el-input>
      </div>
      <div class="date_box u-f u-f-ac">
        <p class="label font14 text_black">{{ $t("时间") }}：</p>
        <el-date-picker
          v-model="dates"
          type="datetimerange"
          :picker-options="pickerOptions"
          unlink-panels
          :range-separator="$t('至')"
          :start-placeholder="$t('开始日期')"
          :end-placeholder="$t('结束日期')"
          align="right"
          value-format="yyyy-MM-dd HH:mm:ss"
        ></el-date-picker>
        <!-- <p class="tip font14 text_danger">{{ $t("只能选择一个月的范围") }}</p> -->
      </div>
      <div class="select_box u-f u-f-ac u-f-jsb">
        <p class="label font14 text_black">{{ $t("打款方式") }}：</p>
        <el-select
          v-model="payMethVal"
          :placeholder="$t('请选择')"
          @change="payMethChange"
        >
          <el-option
            v-for="item in payMethArr"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </div>
      <div class="select_box u-f u-f-ac u-f-jsb">
        <p class="label font14 text_black">{{ $t("状态") }}：</p>
        <el-select
          v-model="clientVal"
          :placeholder="$t('请选择')"
          @change="clientChange"
        >
          <el-option
            v-for="item in clientArr"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </div>
      <button
        class="sub_btn font14 text_white bg_blue"
        @click="getData('search')"
      >
        {{ $t("提交") }}
      </button>
      <button class="export_btn font14 text_white bg_blue" @click="exportExcel">
        {{ $t("导出") }}
      </button>
    </div>

    <div class="head_statis u-f u-fw">
      <div class="txt_list font14 text_black">{{$t('提现总额')}}：<span class="text_blue">{{withdrawal_amount}}</span></div>
      <div class="txt_list font14 text_black">{{$t('实际打款')}}：<span class="text_danger">{{pay_amount}}</span></div>
      <div class="txt_list font14 text_black">{{$t('未提现')}}：<span class="text_danger">{{nwithdrawn}}</span></div>
      <div class="txt_list font14 text_black">{{$t('累计打款')}}：<span class="text_danger">{{pay_amounta}}</span></div>
      <div class="txt_list font14 text_black">{{$t('累计提现')}}：<span class="text_danger">{{withdrawal_amounta}}</span></div>
    </div>

    <div>
      <el-table :data="tableData">
        <el-table-column
          prop="order_no"
          :label="$t('提现单号')"
          width="180"
        ></el-table-column>
        <el-table-column
          prop="create_time"
          :label="$t('申请时间')"
          width="160"
        ></el-table-column>
        <el-table-column
          prop="withdrawal_amount"
          :label="$t('提现金额')"
        ></el-table-column>
        <el-table-column
          prop="service_amount"
          :label="$t('手续费')"
        ></el-table-column>
        
        <el-table-column
          prop="status_text"
          :label="$t('状态')"
        ></el-table-column>
        <el-table-column
          prop="pay_amount"
          :label="$t('实际打款')"
        ></el-table-column>
        <el-table-column prop="agency" :label="$t('用户名')"></el-table-column>
        <el-table-column
          prop="pay_type"
          :label="$t('打款方式')"
        ></el-table-column>
        <el-table-column
          prop="real_name"
          :label="$t('提现名字')"
        >
          <template slot-scope="{row}">
            <span class="font13 text_blue">{{row.real_name}}</span> {{row.identity}}
          </template>
        </el-table-column>
        <el-table-column
          prop="remark"
          :label="$t('提现备注')"
        ></el-table-column>
        <el-table-column :label="$t('操作')" width="180" fixed="right">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="success"
              @click="handleDetail(scope.row)"
              >详情</el-button
            >
            <el-button
              v-if="scope.row.status == 1"
              size="mini"
              type="primary"
              @click="handleExamine(scope.row)"
              >审核</el-button
            >
          </template>
        </el-table-column>
      </el-table>

      <div class="pagination_box ">
        <el-pagination
          background
          @current-change="handleCurrentChange"
          :current-page="page"
          :page-size="page_size"
          layout="total, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
    </div>


    <!-- 订单详情和修改 -->
    <el-dialog
      :title="$t('详情')"
      width="900px"
      :visible.sync="showOrderDetail"
      :close-on-click-modal="false"
    >
      <div class="order_detail">
        <div class="txt_list">
          <span class="lable font14 text_black">{{ $t("提现单号") }}：</span>
          <span class="txt font14 text_black">{{ detail_from.order_no }}</span>
        </div>
        <div class="txt_list">
          <span class="lable font14 text_black">{{ $t("提现时间") }}：</span>
          <span class="txt font14 text_black">{{
            detail_from.create_time
          }}</span>
        </div>
        <div class="txt_list">
          <span class="lable font14 text_black">{{ $t("用户类型") }}：</span>
          <span class="txt font14 text_black">{{ detail_from.user_type }}</span>
        </div>
        <div class="txt_list">
          <span class="lable font14 text_danger">{{ $t("提现金额") }}：</span>
          <span class="txt font14 text_danger"
            >￥{{ detail_from.withdrawal_amount }}</span
          >
        </div>
        <div class="txt_list">
          <span class="lable font14 text_danger">{{ $t("手续费") }}：</span>
          <span class="txt font14 text_danger"
            >￥{{ detail_from.service_amount }}</span
          >
        </div>
        <div class="txt_list">
          <span class="lable font14 text_black">{{ $t("手续费率") }}：</span>
          <span class="txt font14 text_black">{{ detail_from.rate }}%</span>
        </div>
        <div class="txt_list">
          <span class="lable font14 text_black">{{ $t("收款类型") }}：</span>
          <span class="txt font14 text_black">{{
            detail_from.pay_type_text
          }}</span>
        </div>

        <!-- 上传的文件 票据啥的 -->
        <div class="txt_list" v-if="detail_from.bills!=''&&detail_from.bills!=null&&detail_from.bills!=undefined">
          <span class="lable font14 text_black">{{ $t("发票凭证") }}：</span>
          <span class="txt font14 text_black">
            <a href="#" @click="download(detail_from.bills)">发票凭证</a>
          </span>
        </div>
        <div class="txt_list" v-if="detail_from.credential!=''&&detail_from.credential!=null&&detail_from.credential!=undefined">
          <span class="lable font14 text_black">{{ $t("打款凭证") }}：</span>
          <span class="txt font14 text_black">
            <a href="#" @click="download(detail_from.credential)">打款凭证</a>
          </span>
        </div>

        <div class="txt_list">
          <span class="lable font14 text_black">{{ $t("收款账户") }}：</span>
          <span class="txt font14 text_black">{{ detail_from.account }}</span>
        </div>
        <div class="txt_list">
          <span class="lable font14 text_black">{{ $t("收款账户名") }}：</span>
          <span class="txt font14 text_black">{{ detail_from.real_name }}</span>
        </div>
        <div class="txt_list">
          <span class="lable font14 text_black">{{ $t("提现状态") }}：</span>
          <span class="txt font14 text_black">{{
            detail_from.status_text
          }}</span>
        </div>
        <div class="txt_list">
          <span class="lable font14 text_black">{{ $t("实际打款") }}：</span>
          <span class="txt font14 text_black">{{
            detail_from.pay_amount
          }}</span>
        </div>
        <div class="txt_list">
          <span class="lable font14 text_black">{{ $t("打款备注") }}：</span>
          <span class="txt font14 text_black">{{ detail_from.remark }}</span>
        </div>
      </div>
    </el-dialog>

    <!-- 审核 -->
    <el-dialog
      :title="$t('审核')"
      width="900px"
      :visible.sync="showExamine"
      :close-on-click-modal="false"
    >
      <div class="examine_detail">
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_black">{{ $t("提现单号") }}：</p>
          <span class="txt font14 text_black">{{ examineFrom.order_no }}</span>
        </div>
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_black">{{ $t("提现时间") }}：</p>
          <span class="txt font14 text_black">{{
            examineFrom.create_time
          }}</span>
        </div>
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_black">{{ $t("用户类型") }}：</p>
          <span class="txt font14 text_black">{{ examineFrom.user_type }}</span>
        </div>
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_danger">{{ $t("提现金额") }}：</p>
          <span class="txt font14 text_danger"
            >￥{{ examineFrom.withdrawal_amount }}</span
          >
        </div>
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_danger">{{ $t("手续费") }}：</p>
          <span class="txt font14 text_danger"
            >￥{{ examineFrom.service_amount }}</span
          >
        </div>
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_black">{{ $t("手续费率") }}：</p>
          <span class="txt font14 text_black">{{ examineFrom.rate }}%</span>
        </div>
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_black">{{ $t("收款类型") }}：</p>
          <span class="txt font14 text_black">{{
            examineFrom.pay_type_text
          }}</span>
        </div>
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_black">{{ $t("收款账户") }}：</p>
          <span class="txt font14 text_black">{{ examineFrom.account }}</span>
        </div>
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_black">{{ $t("收款账户名") }}：</p>
          <span class="txt font14 text_black">{{ examineFrom.real_name }}</span>
        </div>
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_black">{{ $t("状态") }}：</p>
          <el-radio-group v-model="examineFrom.status">
            <el-radio :label="2">{{ $t("打款") }}</el-radio>
            <el-radio :label="3">{{ $t("拒绝") }}</el-radio>
          </el-radio-group>
        </div>
        <div class="ipt_list u-f u-f-ac" v-show="examineFrom.status == 2">
          <p class="lable font14 text_black">{{ $t("实际打款") }}：</p>
          <el-input
            v-model="examineFrom.pay_amount"
            :placeholder="$t('请输入')"
          ></el-input>
        </div>
        <div class="ipt_list u-f">
          <p class="lable font14 text_black">{{ $t("备注") }}：</p>
          <el-input
            v-model="examineFrom.remark"
            autosize
            type="textarea"
            :placeholder="$t('请输入')"
          ></el-input>
        </div>

        <el-button type="primary" @click="examineSubmit">{{ $t("提交") }}</el-button>
      </div>
    </el-dialog>

    <!-- 审核 -->
    <el-dialog
      :title="$t('审核')"
      width="900px"
      :visible.sync="showExamine1"
      :close-on-click-modal="false"
      :before-close="handleClose1"
    >
      <div class="examine_detail">
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_black">{{ $t("提现时间") }}：</p>
          <span class="txt font14 text_black">{{
            examineFrom1.create_time
          }}</span>
        </div>
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_danger">{{ $t("打款金额") }}：</p>
          <span class="txt font14 text_danger"
            >￥{{ examineFrom1.withdrawal_amount }}</span
          >
        </div>
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_danger">{{ $t("真实姓名") }}：</p>
          <span class="txt font14 text_danger"
            >{{ examineFrom1.name }}</span
          >
        </div>
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_danger">{{ $t("银行") }}：</p>
          <span class="txt font14 text_danger"
            >{{ examineFrom1.bankname }}</span
          >
        </div>

        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_danger">{{ $t("银行账户") }}：</p>
          <span class="txt font14 text_danger"
            >{{ examineFrom1.banknumber }}</span
          >
        </div>        


        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_danger">{{ $t("发票凭证") }}：</p>
          <a class="txt font14 text_danger" href="#" @click="download(examineFrom1.bills)"
            >发票凭证</a
          >
        </div>

        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_danger">{{ $t("分行") }}：</p>
          <span class="txt font14 text_danger"
            >{{ examineFrom1.branch }}</span
          >
        </div>
        
        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_danger">{{ $t("备注") }}：</p>
          <span class="txt font14 text_danger"
            >{{ examineFrom1.remark }}</span
          >
        </div>
<!-- 
        <div class="ipt_list u-f">
          <p class="lable font14 text_black">{{ $t("备注") }}：</p>
          <el-input
            v-model="examineFrom.remark"
            autosize
            type="textarea"
            :placeholder="$t('请输入')"
          ></el-input>
        </div> -->

        <div class="txt_list u-f u-f-ac">
            <div class="basic">
              <div class="img_list">
                <div class="upload_img" v-if="adver_img">
                  <img :src="adver_img"/>
                </div>
                <el-upload action='https://cdb.workair.vip/operate/finance/fileUpload' :headers="{ token, ocode }"
                  name="img_file" :data="{ type: 'image' }" :file-list="adverFile" :limit="1" :on-exceed="handleAdvExceed"
                  :on-success="handleAdvSuccess" :on-remove="handleAdvRemove" :on-error="handleAdvError">
                  <el-button type="primary">{{ $t('选择文件') }}</el-button>
                </el-upload>

                <!-- <el-upload
                  class="basic"
                  name="img_file"
                  action="https://cdb.workair.vip/operate/finance/fileUpload"
                  :data="{ type: 'image' }"
                  :headers="{ token, ocode }"
                  :on-preview="handlePreview"
                  :on-remove="handleRemove"
                  :before-remove="beforeRemove"
                  multiple
                  :limit="3"
                  :on-exceed="handleExceed"
                  :file-list="fileList">
                  <el-button size="small" type="primary">点击上传</el-button>
                  <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
                </el-upload> -->
              </div>
              <!-- <el-button class="submit_btn" type="primary" @click="adv_submit">{{ $t('提交') }}</el-button> -->
            </div>
        </div>

        <div class="txt_list u-f u-f-ac">
          <p class="lable font14 text_black">{{ $t("状态") }}：</p>
          <el-radio-group v-model="examineFrom1.status">
            <el-radio :label="2">{{ $t("打款") }}</el-radio>
            <el-radio :label="3">{{ $t("拒绝") }}</el-radio>
          </el-radio-group>
        </div>

        <el-button type="primary" @click="examineSubmit1">{{ $t("提交") }}</el-button>

      </div>
    </el-dialog>
      <el-dialog
        title="提示"
        :visible.sync="dialogExcel"
        width="30%"
        :before-close="excelClose">
        <span style="height: 5px;">导出数量</span>
        <span slot="footer" class="dialog-footer">
          <el-button @click="getData('3')">单页</el-button>
          <el-button type="primary" @click="getData('4')">全部</el-button>
        </span>
      </el-dialog>

    <refresh @click="handleRefresh"></refresh>
  </div>
</template>

<script>
import util from "@/assets/js/util.js";
import { mapState } from "vuex";
export default {
  name: "finance-withdrawalList",
  data() {
    let that = this;
    return {
      showExamine1: false,
      page: 1,
      page_size: 20,
      total: 0,
      username: "",
      drawname: "",
      clientVal: 0,
      clientArr: [
        {
          value: 0,
          label: that.$t("选择状态"),
        },
        {
          value: 1,
          label: that.$t("审核中"),
        },
        {
          value: 2,
          label: that.$t("已打款"),
        },
        {
          value: 3,
          label: that.$t("已拒绝"),
        },
      ],
      payMethVal: 0,
      payMethArr: [
        {
          value: 0,
          label: that.$t("请选择"),
        },
        {
          value: -1,
          label: that.$t("对公打款"),
        },
        {
          value: 1,
          label: that.$t("微信"),
        },
        {
          value: 2,
          label: that.$t("支付宝"),
        },
        {
          value: 3,
          label: that.$t("银行卡"),
        },
      ],
      dates: "",
      pickerOptions: {
        shortcuts: [
          {
            text: that.$t("最近一周"),
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: that.$t("最近一个月"),
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: '最近三个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setMonth(start.getMonth() - 3);
              // start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: '最近六个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setMonth(start.getMonth() - 6);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: '最近十二个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setMonth(start.getMonth() - 12);
              // start.setTime(start.getTime() - 3600 * 1000 * 24 * 360);
              picker.$emit('pick', [start, end]);
            }
          },
        ],
      },
      is_export: 0,
      pay_amount: '',
      withdrawal_amount: '',
      pay_amounta: '',
      withdrawal_amounta: '',
      nwithdrawn:'',
      adverFile: [],
      tableData: [],
      showOrderDetail: false,
      detail_from: {},
      showExamine: false,
      examineFrom: {},
      examineFrom1:{
        id:0,
        withdrawal_amount: '',
        name: '',
        bankname: '',
        banknumber: '',
        branch:'',
        account:'',
        remark: '',
        status: 0,
        state:0,
        uid:0,
        bills: ''
      },
      adver_id:'',
      adver_img:'',
      dialogExcel: false
    };
  },
  computed: {
    ...mapState(["permissions","token","memusid","uid","ocode"])
  },
  mounted() {
    let arr = util.getDate('month')
    this.dates = [ arr[0] + ' 00:00:00', arr[1] + ' 23:59:59' ]
    this.getData();
  },
  methods: {
    download(val){
      window.open(val);
    },
    handleAdvError(err) {
        console.log("打印一下怎么个事！")
        console.log(err);
        this.$message({
          message: this.$t("上传失败"),
          type: "warning"
        });
    },
    handleAdvRemove() {
        this.adver_id = "";
        this.adver_img = "";
        this.adver_img1 = "";
    },

    handleAdvSuccess(response, file) {
        console.log("打印成功了奥");
        console.log(response);
        console.log(file);
        this.adver_id = response.msg;
        this.adver_img = response.path;
        
      },
    handleAdvExceed() {
        this.$message({
          message: this.$t("只能上传一张"),
          type: "warning"
        });
    },
    
    handleRefresh() {
      let arr = util.getDate('month')
      this.dates = [ arr[0] + ' 00:00:00', arr[1] + ' 23:59:59' ]
      this.page = 1;
      this.page_size = 20;
      this.username = "";
      this.drawname = "";
      this.clientVal = 0;
      this.payMethVal = 0;
      this.is_export = 0
      this.getData();
    },
    handleClose1(){
      console.log("点击了奥")
      this.showExamine1 = false;
    },
    getData(type) {
      if(type == '3'){
        util.$http('/finance/withdrawalListExcel?page=' + this.page, {
            page_size: this.page_size,
            order_no: this.order_id,
            name: this.agent,
            status: this.clientVal,
            phone: this.phone,
            start_time: this.dates[0] || "",
            end_time: this.dates[1] || "",
            is_excel: 1
          })
        .then(res=>{
          var uel = res.data.substring(13);

          // window.open(res.data.substring(13), '_blank');

          var reg2 = new RegExp("public/"); // 不加'g'，仅删除字符串里第一个"a"
          var a2 = uel.replace(reg2,"");
          console.log(a2);

          window.open('https://'+a2, '_blank');

          // let path=window.location.protocol+'//'+res
          // window.location.href=path
          
          // if(res.code == 1) {

            // this.total = res.data.total
            // this.tableData = res.data.list
            // this.stat = res.data.stat
          // }
        })
      }else if(type == '4'){
        util.$http('/finance/withdrawalListExcel?page=' + this.page, {
            page_size: this.page_size,
            order_no: this.order_id,
            name: this.agent,
            status: this.clientVal,
            phone: this.phone,
            start_time: this.dates[0] || "",
            end_time: this.dates[1] || "",
            is_excel: 2
          })
        .then(res=>{
          var uel = res.data.substring(13);

          // window.open(res.data.substring(13), '_blank');

          var reg2 = new RegExp("public/"); // 不加'g'，仅删除字符串里第一个"a"
          var a2 = uel.replace(reg2,"");
          console.log(a2);

          window.open('https://'+a2, '_blank');

          // let path=window.location.protocol+'//'+res
          // window.location.href=path
          
          // if(res.code == 1) {

            // this.total = res.data.total
            // this.tableData = res.data.list
            // this.stat = res.data.stat
          // }
        })
      }else{
        if (type == "search") {
          this.page = 1;
          this.is_export = 0
        }
      util
        .$http("/finance/withdrawalList?page=" + this.page, {
          page_size: this.page_size,
          agency: this.username,
          name: this.drawname,
          status: this.clientVal,
          pay_type: this.payMethVal,
          start_time: this.dates[0] || "",
          end_time: this.dates[1] || "",
          is_execl: this.is_export
        })
        .then((res) => {
          if (res.code == 1) {
            this.total = res.data.total;
            this.tableData = res.data.list;
            this.withdrawal_amount = res.data.withdrawal_amount
            this.pay_amount = res.data.pay_amount
            this.withdrawal_amounta = res.data.withdrawal_amounta
            this.pay_amounta = res.data.pay_amounta
            this.nwithdrawn = res.data.nwithdrawn

          }else if(res.code == 301) {
            window.location.href = res.msg
          }
        });
      }

      
    },
    clientChange(val) {
      this.clientVal = val;
    },
    payMethChange(val) {
      this.payMethVal = val;
    },
    handleDetail(row) {
      this.showOrderDetail = true;
      setTimeout(() => {
        util
          .$http("/finance/withdrawalDetail", {
            id: row.id,
          })
          .then((res) => {
            if (res.code == 1) {
              this.detail_from = res.data;
              console.log("打印一下子")
              console.log(this.detail_from);
            }
          });
      }, 150);
    },
    handleExamine(row) {
      console.log("打印一下子判断是否是后台的审核")
      console.log(row);
      if(row.state){
        this.showExamine1 = true
        setTimeout(() => {
          util
            .$http("/finance/withdrawalDetail", {
              id: row.id,
            })
            .then((res) => {
              if (res.code == 1) {
                console.log("打印一下返回值是多少哈");
                console.log(res.data);
                
                this.examineFrom1.id = res.data.id;
                this.examineFrom1.withdrawal_amount = res.data.withdrawal_amount;
                this.examineFrom1.name = res.data.name;
                this.examineFrom1.bankname = res.data.account_info.bank;
                this.examineFrom1.banknumber = res.data.account;
                this.examineFrom1.branch = res.data.account_info.bank_branch;
                this.examineFrom1.remark = res.data.remark;
                this.examineFrom1.status = res.data.status;
                this.examineFrom1.state = res.data.state;
                this.examineFrom1.bills = res.data.bills;
                this.examineFrom1.create_time = res.data.create_time;
                console.log("打印一下examinefrom1");
                console.log(this.examineFrom1);

                
                // this.examineFrom1 = res.data

              }
            });
        }, 150);
      }else{
        this.showExamine = true
        setTimeout(() => {
          util
            .$http("/finance/withdrawalDetail", {
              id: row.id,
            })
            .then((res) => {
              if (res.code == 1) {
                this.examineFrom = res.data
              }
            });
        }, 150);
      }
    },
    examineSubmit1(){
        if(this.memusid==5){
          this.examineFrom1.state = 1;
        }else if(this.memusid==6){
          this.examineFrom1.state = 2;
        }

        // if(this.adver_img==""){
        //   this.$message({
        //     message: this.$t("请上传图片"),
        //     type: "warning"
        //   });
        // }

        this.examineFrom1.reimg = this.adver_img;
        this.examineFrom1.uid = this.uid;
        util
        .$http("/finance/withdrawalreEdit", this.examineFrom1)
        .then(res => {
          if (res.code == 1) {
            this.$message({
              message: res.msg,
              type: "success"
            });
            // this.showAddCab = false;
            this.getData();
            this.showExamine1 = false;
          }
        });
      },

    examineSubmit() {
      util
        .$http("/finance/withdrawalAudit", {
          id: this.examineFrom.id,
          status: this.examineFrom.status,
          pay_amount: this.examineFrom.pay_amount,
          remark: this.examineFrom.remark
        })
        .then((res) => {
          if (res.code == 1) {
            this.$message({
              message: res.msg,
              type: 'success'
            })
            this.showExamine = false
            this.examineFrom = {}
            this.getData()
          }
        });
    },
    handleCurrentChange(val) {
      this.page = Number(val);
      this.is_export = 0
      this.getData();
    },

    logExcelA(){
      this.dialogExcel = true;
    },

    excelClose(){
      this.dialogExcel = false;
    },

    exportExcel() {
      this.dialogExcel = true;
    },

    formatJson(filterVal, data) {
      return data.map((v) =>
        filterVal.map((j) => {
          if (j === "timestamp") {
            return parseTime(v[j]);
          } else {
            return v[j];
          }
        })
      );
    },
  },
};
</script>

<style scoped>
.head_search {
  margin-bottom: 20px;
}
.head_search .ipt_box {
  width: 260px;
  margin-right: 20px;
}
.head_search .ipt_box .el-input {
  width: 200px;
}
.head_search .date_box {
  width: 480px;
  margin-right: 20px;
}
.head_search .date_box .tip {
  width: 150px;
  margin: 0 0 0 10px;
}
.head_search .select_box {
  width: 280px;
  margin-right: 20px;
}
.head_search .select_box .el-select {
  width: 200px;
}
.head_search .switch_box {
  width: 151px;
  margin-right: 20px;
}
.head_search .sub_btn {
  width: 70px;
  height: 40px;
  border: 0;
  outline: 0;
  cursor: pointer;
  border-radius: 4px;
  margin-right: 20px;
}
.head_search .export_btn {
  width: 70px;
  height: 40px;
  border: 0;
  outline: 0;
  cursor: pointer;
  border-radius: 4px;
}
.head_tip {
  margin: 0 0 10px 0;
  padding-bottom: 5px;
  border-bottom: 1px solid #ebeef5;
}
.head_statis {
  margin: 20px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #ebeef5;
}
.head_statis .txt_list{
  width: 170px;
  margin-bottom: 5px;
}
.iconfont {
  font-size: 15px;
  margin-right: 5px;
}
.el-button--mini,
.el-button--mini.is-round {
  padding: 7px 10px;
}
.pagination_box {
  padding-top: 30px;
}
.pagination_box .el-pagination {
  display: flex;
  justify-content: flex-end;
}
.order_detail {
  padding: 0 10px;
  margin-top: -15px;
}
.order_detail .txt_list {
  margin-bottom: 15px;
}
.examine_detail {
  padding-left: 50px;
  margin-top: -15px;
}
.examine_detail .txt_list {
  margin-bottom: 15px;
}
.examine_detail .txt_list .lable {
  min-width: 100px;
  margin: 0;
}
.examine_detail .ipt_list {
  margin-bottom: 15px;
}
.examine_detail .ipt_list .lable {
  min-width: 100px;
  margin: 0;
}
.examine_detail .ipt_list .el-input {
  width: 150px;
  margin-right: 15px;
}
.examine_detail .el-input .el-input__inner {
  height: 36px;
  line-height: 36px;
}
.examine_detail .ipt_list .el-textarea {
  width: 300px;
}
.examine_detail .el-button {
  margin-top: 30px;
}
</style>
<style>
.examine_detail .ipt_list .el-textarea__inner {
  min-height: 90px !important;
}
</style>